package chulixuan.foundation.flowControl;

/**
 * 遍历1-100以内的偶数，并获取偶数的个数，获取所有的偶数的和
 */
public class Demo0000000003 {
    public static void main(String[] args) {
        int count = 0;
        int sum = 0;
        for (int i = 1; i < 100; i++) {
            if (i % 2 == 0) {
                count++;
                sum = sum + i;

            }
        }
        System.out.println("sum = " + sum);
        System.out.println("count = " + count);
    }

}
